//
//  LocationIncubationCell.m
//  BigToBig
//
//  Created by yi liu on 16/7/27.
//  Copyright © 2016年 cn.cloudtp. All rights reserved.
//

#import "LocationIncubationCell.h"

@implementation LocationIncubationCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}


- (void)createSubViews{
    //  头像
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (kScreenWidth - 20)/6, (kScreenWidth - 20)/6)];
    self.headImageView.center = CGPointMake(self.headImageView.width / 2 + 10, 50);
    self.headImageView.image = [UIImage imageNamed:@"touxiang"];
    [self addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = (kScreenWidth - 20)/12;
    self.headImageView.layer.masksToBounds = YES;
    
    // 标题
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.maxX + 10, self.headImageView.y, kScreenWidth/2 - self.headImageView.maxX - 10, self.headImageView.height /3)];
    self.titleLabel.text = @"创业生态园";
    [self addSubview:self.titleLabel];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    
    
    // 描述
    self.describeLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.titleLabel.maxY + 5, kScreenWidth - self.titleLabel.x - 10, self.titleLabel.height)];
    [self addSubview:self.describeLabel];
    self.describeLabel.font = [UIFont systemFontOfSize:13];
    self.describeLabel.textColor = [UIColor lightGrayColor];
    
    
    // 面积
    self.areaLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.describeLabel.maxY + 5, kScreenWidth / 9 * 2 , self.describeLabel.height)];
    self.areaLabel.font = [UIFont systemFontOfSize:12];
    self.areaLabel.textColor = [UIColor lightGrayColor];
    self.areaLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.areaLabel];
    

    
    // 租金
    self.rentLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.areaLabel.maxX + 10, self.areaLabel.y, kScreenWidth / 9 * 3 , self.areaLabel.height)];
    self.rentLabel.font = [UIFont systemFontOfSize:11];
    self.rentLabel.textColor = [UIColor lightGrayColor];
    self.rentLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.rentLabel];
    
    // 位置图标
    UIImageView *positionImageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.rentLabel.maxX, self.rentLabel.y, self.headImageView.width / 7 * 3 - 5, self.headImageView.width / 7 * 3)];
    positionImageView.image = [UIImage imageNamed:@"dingwei"];
    [self addSubview:positionImageView];
    
    // 位置
    self.positionlabel = [[UILabel alloc]initWithFrame:CGRectMake(positionImageView.maxX, positionImageView.y, kScreenWidth - positionImageView.maxX - 10, positionImageView.height)];
    self.positionlabel.textAlignment = NSTextAlignmentCenter;
    self.positionlabel.textColor = [UIColor lightGrayColor];
    self.positionlabel.font = [UIFont systemFontOfSize:15];
    [self addSubview:self.positionlabel];
    
    // 底层分割线
    UILabel *bottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 99, kScreenWidth, 1)];
    bottomLabel.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self addSubview:bottomLabel];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
